package com.googlecode.latvian_ebooks.glossary;

import scala.reflect.BeanProperty

/**
 * This class encapsulates one occurence of a term - 
 * i.e. fragment number and position within a fragment
 */
class Location(@scala.reflect.BeanProperty var fragmentNum: Int,
  @scala.reflect.BeanProperty var position: Int) {

  override def toString():String = {
    if (position == 0) "" + fragmentNum
    else "" + fragmentNum + ":" + position
  }

  def this(locString: String) {
    this(Integer.parseInt(locString), 0)
  }
}
